package com.test.deencredit.bean_deencredit;

import static com.test.deencredit.status_deencredit.PermissionStatus_deencredit.*;

import android.text.TextUtils;

import com.test.deencredit.adapter_deencredit.PermissionViewAdapter_deencredit;
import com.test.deencredit.listener_deencredit.PermissionListener_deencredit;
import com.test.deencredit.status_deencredit.PermissionStatus_deencredit;

public class PermissionInfo_deencredit {

    private PermissionStatus_deencredit status = Default_deencredit;

    private final Integer iconResId;
    private final String title;
    private final String text;
    private final PermissionListener_deencredit listener;

    private PermissionViewAdapter_deencredit.PermissionDialogHolder_deencredit holder;

    private final String page_deencredit;

    public PermissionInfo_deencredit(Integer iconResId, String title, String text, PermissionListener_deencredit listener, String page) {
        this.iconResId = iconResId;
        this.title = title;
        this.text = text;
        this.listener = listener;
        this.page_deencredit = page;
    }

    public Integer getIconResId_deencredit() {
        return iconResId;
    }

    public String getTitle_deencredit() {
        return title;
    }

    public String getText_deencredit() {
        if (TextUtils.isEmpty(text)) return "";
        return text;
    }

    public PermissionListener_deencredit getListener_deencredit() {
        return listener;
    }

    public String getPage_deencredit() {
        if (TextUtils.isEmpty(page_deencredit)) return "";
        return page_deencredit;
    }

    public void setStatus_deencredit(PermissionStatus_deencredit status) {
        this.status = status;
    }

    public PermissionStatus_deencredit getStatus_deencredit() {
        return status;
    }

    public void setHolder_deencredit(PermissionViewAdapter_deencredit.PermissionDialogHolder_deencredit holder) {
        this.holder = holder;
    }

    public void onPermissionAgree_deencredit(){
        if (listener!=null) listener.onPermissionAgree_deencredit();
    }

    public void onPermissionDeny_deencredit(){
        if (listener!=null) listener.onPermissionDeny_deencredit();
    }

    public void next_deencredit(){
        if (listener!=null) listener.onNextClick_deencredit();
    }

}
